Regular Expression to remove the carriage return

I have string like below
string s = " B1.00
B10.00
B15.00
...."

String value is taken from one of the attribute field and number of data varies from object to object with similar data.

I want to remove the carriage return ( new line ) and print the above into the same line like "B1.00B10.00B15.00"
after that i want to store the data shown above into array like array a = {100,1000,1500}

Please help me if someone can provide me the snippet of the code?
SystemAdmin - Wed Feb 06 08:42:02 EST 2013

Re: Regular Expression to remove the carriage return
Gedinfo - Wed Feb 06 12:04:03 EST 2013

Here is how I handle replacing a carriage return with a space.
Perhaps you could modify it to your need.
 

/******************************************************************************
  fReplaceNewLine
  
  Replaces newlines in a buffer with spaces
******************************************************************************/
void fReplaceNewLine(Buffer in_buf)
{       // Replace all occurances of new line to space in the Buffer
        char in_cFrom = cl_cEOL
        char in_cTo = ' '
        if (null in_buf)
                return
        int i
        for (i=0; i<length(in_buf); i++)
        {  
                if (in_buf[i] == in_cFrom) 
                        set(in_buf, i, in_cTo)
        } // end for (i=0; i<length(in_buf); i++)
} // fReplaceNewLine()

Re: Regular Expression to remove the carriage return
Mathias Mamsch - Thu Feb 07 03:50:14 EST 2013

Please do not repost. See this question: http://www.ibm.com/developerworks/forums/thread.jspa?threadID=457653&tstart=0

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS